﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using WMSADL.SY;
using WMSAML.SY;

namespace WMSABL.SY
{
    public class TDictionary_CategoryBLL
    {
        TDictionary_CategoryDAL dal = new TDictionary_CategoryDAL();

        /// <summary>
        /// 
        /// </summary>
        public bool Add_Category(int sortid, string categoryVale)
        {
            TDictionary_CategoryEntity entity = new TDictionary_CategoryEntity();
            entity.SortID=sortid;
            entity.Value = categoryVale;
            if (this.Add_Dictionary_Category(entity) >0)
            {
                return true;
            }
            return false;
        }
        /// <summary>
        /// 
        /// </summary>
        public int Add_Dictionary_Category(TDictionary_CategoryEntity entity)
        {
            return dal.Add_Dictionary_Category(entity);
        }

        /// <summary>
        /// ByID
        /// </summary>
        /// <summary>
        public TDictionary_CategoryEntity GetEntityByID_Dictionary_Category(int id)
        {
            return dal.GetEntityByID_Dictionary_Category(id);
        }

        /// <summary>
        /// ByName
        /// </summary>
        /// <summary>
        public TDictionary_CategoryEntity GetEntityByName_Dictionary_Category(int sortid, string name)
        {
            return dal.GetEntityByName_Dictionary_Category(sortid,name);
        }

        /// <summary>
        ///  删除
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>bool</returns>
        public bool Del_Dictionary_Category(int id)
        {
            return dal.Del_Dictionary_Category(id);
        }

        /// <summary>
        ///  修改信息
        /// </summary>
        /// <param name="entity">entity</param>
        /// <returns>bool</returns>
        public bool Update_Dictionary_Category(TDictionary_CategoryEntity entity)
        {
            return dal.Update_Dictionary_Category(entity);
        }
    }
}
